var readline = require('readline');//按行读取文件
var fs=require("fs");//文件读取模块
//定义读取(一行一行的读取)方法
function read_file(path,callback){
    var fRead = fs.createReadStream(path);
    var objReadline = readline.createInterface({
        input:fRead
    });
    var arr = new Array();
    objReadline.on('line',function (line) {
        arr.push(line);
    });
    objReadline.on('close',function () {
        callback(arr);
    });
}
module.exports = read_file; 